<?php
/**
 * Bootstrap Doctrine.php, register autoloader specify
 * configuration attributes and load models.
 */
include_once 'lib/phpctls/PhpCtls.php';
require_once(dirname(__FILE__) . '/lib/Doctrine/Doctrine.php');
spl_autoload_register(array('Doctrine', 'autoload'));
spl_autoload_register(array('Doctrine_Core', 'modelsAutoload')); 
Doctrine_Core::setModelsDirectory(QC_SYS_BASEDIR . '/models'); 

$manager = Doctrine_Manager::getInstance();

$engine = 'mysql';
$db = 'newqcrud';
$host = '127.0.0.1';
$user = 'root';
$port = '3306';

$dsn1 = $engine . ':' . '//' . $user . ':' . $password . '@' . $host . ':' . $port . '/' . $db;

$conn = Doctrine_Manager::connection($dsn1,'maindb');

//$manager->setCurrentConnection('docquickcrud');

 $manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);
 $manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);

$manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);

//$manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);

//Doctrine::loadModels(QC_SYS_BASEDIR . '/models');

 $manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);



 
?>
